package com.xinxin.blockchain.dao.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xinxin.blockchain.dao.IAccountAssetDao;
import com.xinxin.blockchain.mapper.AccountAssetMapper;
import com.xinxin.blockchain.model.AccountAsset;

import java.util.List;

/**
 * <p>
 * 账户资产表 服务实现类
 * </p>
 *
 * @author ys
 * @since 2021-05-24
 */
public class AccountAssetDao extends ServiceImpl<AccountAssetMapper, AccountAsset> implements IAccountAssetDao {

    @Override
    public List<AccountAsset> listByType(Long accountId, Integer type) {
        Wrapper<AccountAsset> queryWrapper = new QueryWrapper<AccountAsset>().lambda()
                .eq(AccountAsset::getDataStatus, true)
                .eq(AccountAsset::getAccountId, accountId)
                .eq(AccountAsset::getType, type);
        return baseMapper.selectList(queryWrapper);
    }
}
